<!--
 * @Author: DUST
 * @Date: 2023-06-29 10:01:10
 * @LastEditors: DUST
 * @LastEditTime: 2023-06-29 10:25:32
 * @FilePath: \vite-project\src\views\blankWaitting.vue
 * @Description: 
 * undefined
-->
<template>
  <div class="weittingPage">
    <div class="turnToBox">
      <div class="topWebsiteInfo">
        <img class="websiteLogo" :src="info.logoUrl" alt="" />
        <div class="websiteInfo">
          <div class="websiteName">{{ info.name }}</div>
          <div class="websiteDesc">{{ info.description }}</div>
        </div>
      </div>
      <div class="tipsText">您确认要离开我们去到新页面么？</div>
      <div class="footer">
        <a-button class="btnStyle" @click="cancel">返回</a-button>
        <a-button class="btnStyle" type="primary" @click="goWebsite">
          {{ btnText }}
        </a-button>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import router from "@/router";
import { ref } from "vue";
import { websiteInterface } from "./admin/navigate";

const info = ref<websiteInterface>(
  router.currentRoute.value.query as unknown as websiteInterface
);

const btnText = ref<string>("确认");

const goWebsite = () => {
  window.location.href = info.value.url;
};
const cancel = () => {
  window.close();
}
</script>

<style lang="less" scoped>
.weittingPage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  .turnToBox {
    box-shadow: 0 0 6px 2px #eee;
    width: 400px;
    height: 200px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .tipsText {
      width: 100%;
      line-height: 30px;
      font-size: 14px;
      color: #999;
      border-top: 1px solid #eee;
    }
    .topWebsiteInfo {
      width: 240px;
      height: 120px;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      padding: 10px;
      box-sizing: border-box;
      .websiteInfo {
        width: calc(100% - 60px);
        line-height: 35px;
        // padding-top: 20px;
        // box-sizing: border-box;
        .websiteName {
          font-size: 18px;
          font-weight: bold;
        }
        .websiteDesc {
          width: 100%;
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
          font-size: 14px;
          color: #999;
        }
      }
      .websiteLogo {
        width: 50px;
        height: 50px;
      }
    }
    .footer {
      width: 100%;
      height: 50px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      padding: 0 50px;
      box-sizing: border-box;
      .btnStyle {
        width: 130px;
      }
    }
  }
}
</style>
